package main

func distributeCandies(candies int, num_people int) []int {
	people := make([]int, num_people)
	num := 1
	for i := 0; i < num_people && candies > 0; {
		if candies < num {
			people[i] += candies
			break
		}
		people[i] += num
		candies -= num
		num++
		i++
		i %= num_people
	}

	return people
}
